package com.iotechn.unimall.admin.api.distribution;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.annotation.param.Range;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.DistributionStrategyDO;
import com.iotechn.unimall.data.model.Page;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: rize
 * Date: 2019/11/27
 * Time: 19:12
 */
@HttpOpenApi(group = "admin.distributionstrategy", description = "抽点策略服务")
public interface AdminDistributionStrategyService {

    @HttpMethod(description = "创建", permission = "operation:distributionstrategy:create", permissionParentName = "运营管理", permissionName = "分销策略")
    public String create(
            @NotNull @Range(min = 1, max = 3) @HttpParam(name = "type", type = HttpParamType.COMMON, description = "类型") Integer type,
            @NotNull @HttpParam(name = "typeId", type = HttpParamType.COMMON, description = "类型Id") Long typeId,
            @HttpParam(name = "radio", type = HttpParamType.COMMON, description = "一级抽点") Integer radio,
            @HttpParam(name = "firstRadio", type = HttpParamType.COMMON, description = "一级抽点") Integer firstRadio,
            @HttpParam(name = "secondRadio", type = HttpParamType.COMMON, description = "二级抽点") Integer secondRadio,
            @HttpParam(name = "thirdRadio", type = HttpParamType.COMMON, description = "三级抽点") Integer thirdRadio,
            @HttpParam(name = "mergeType", type = HttpParamType.COMMON, description = "上级销售策略类型") Integer mergeType,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "编辑", permission = "operation:distributionstrategy:edit", permissionParentName = "运营管理", permissionName = "分销策略")
    public String edit(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") Long id,
            @HttpParam(name = "radio", type = HttpParamType.COMMON, description = "一级抽点") Integer radio,
            @HttpParam(name = "firstRadio", type = HttpParamType.COMMON, description = "一级抽点") Integer firstRadio,
            @HttpParam(name = "secondRadio", type = HttpParamType.COMMON, description = "二级抽点") Integer secondRadio,
            @HttpParam(name = "thirdRadio", type = HttpParamType.COMMON, description = "三级抽点") Integer thirdRadio,
            @HttpParam(name = "mergeType", type = HttpParamType.COMMON, description = "上级销售策略类型") Integer mergeType,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "列表", permission = "operation:distributionstrategy:list", permissionParentName = "运营管理", permissionName = "分销策略")
    public Page<DistributionStrategyDO> list(
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "订单页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "搜索类型") Integer type,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "operation:distributionstrategy:delete", permissionParentName = "运营管理", permissionName = "分销策略")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "策略Id") Long id) throws ServiceException;

}
